From BlenderWiki

Jump to: navigation, search
Note: This is an archived version of the Blender Developer Wiki. The current and active wiki is available on wiki.blender.org.

Hi Khughes,

I was trying to run the second example "Or to print all the constraints attached to each bone in a pose" on Python Constrants API.

I was getting a "NameError: name 'pose' is not defined" error message until I added the line :

pose = ob.getPose() to the script. It seems to be working now. I updated that page to include that code.

Also the original code had

print bone.name,'=>'const.type

which was also getting an error (missing "," between '=>' and 'const.type'.

And finally 'const.type' just prints a 'cryptic' number, while

'print const'

actually prints out the english description of the constraint, so I changed the code to that, thinking it might be more useful :)

Also 'print const' actually prints :

  [Constraint "Const.001", Type "IK Solver"]

in my test script. I was trying to isolate the description (second item).

I tried

print const[1]

but I get a "KeyError: 'key not found'" message.

Is there a way to print or get at the second value in that 'list'  ?


--Mstram 11:38, 13 May 2006 (CEST)

The output is not a list but a string. Just happens to look somewhat like a list. It is generated by an internal Blender function which is used to print the constraint name for the UI.

While the print output is more readable than the integer in the const.type attribute, it usually will be the case that this value is compared to one of the constants in Constraint.Types, so the code itself will be readable.

--khughes 7:23, 13 May 2006 (PDT)


Ok, thx, someone else on BlenderArtists also mentioned the Constraint.Types, do you mean the python object? If so, in my CVS Windows build it's listed as Blender.Constraint.Type (no s).

--Mstram 19:58, 13 May 2006 (CEST)

x86_64

As you are involved with the 64 bit version, you may be able to help with some questions: What is the current x86_64 situation? Is there a web page? Is there a stable build somewhere? There is nothing on the official website, or at least I cannot find anything. If I search the forums, all I can find is an old reference saying that 64-bit build output incorrect .build files, which I know is no longer true. Also, should we use the 32 bit version instead? Will that cope with a 64 bit Python? M.e 08:10, 29 April 2007 (CEST)